import request from '@/utils/request'

//
const api = {
    list: '/boss/project/manage/listRecord',
    userList: '/boss/project/info/list',
    projectDetail: '/boss/project/info/detail', // 查
    projectAdd: '/boss/project/info/add', // 增
    projectUpdate: '/boss/project/info/update', // 改
    projectDelete: '/boss/project/info/delete', // 删
    templateList: '/boss/project/manage/listCon', // 合同模版
    updateCon: '/boss/project/manage/updateCon',
    showResearcher: '/boss/project/manage/showResearcher', // 显示人员
    addContract: '/boss/project/manage/addContract', // 发起合同签属
    contractConfig: '/boss/project/manage/contractConfig', // 合同文件签署配置
    addCon: '/boss/project/manage/addCon',
    getName: '/boss/project/info/show', // 根据id查名字
    showUserNo: '/boss/project/manage/showUserNo', // 获取签署人下拉列表
    exportContract: '/boss/project/manage/exportContract', // 合同列表导出
    updatePDFConfig: '/boss/project/manage/updatePDFConfig' // 更新pdf
}

export function list (parameter) {
    return request({
        url: api.list,
        method: 'post',
        data: parameter
    })
}

export function getProjectList (parameter) {
    return request({
      url: api.userList,
      method: 'post',
      data: parameter
    })
}

export function getProjectDetail (parameter) {
    return request({
      url: api.projectDetail,
      method: 'post',
      data: parameter
    })
  }
export function getProjectAdd (parameter) {
  return request({
    url: api.projectAdd,
    method: 'post',
    data: parameter
  })
}
export function getProjectUpdate (parameter) {
  return request({
    url: api.projectUpdate,
    method: 'post',
    data: parameter
  })
}
export function getProjectDelete (parameter) {
  return request({
    url: api.projectDelete,
    method: 'post',
    data: parameter
  })
}
export function getTemplateList (parameter) {
  return request({
    url: api.templateList,
    method: 'post',
    data: parameter
  })
}
export function switchUpdateCon (parameter) {
  return request({
    url: api.updateCon,
    method: 'post',
    data: parameter
  })
}
export function getShowResearcher (parameter) {
  return request({
    url: api.showResearcher,
    method: 'post',
    data: parameter
  })
}
export function getAddContract (parameter) {
  return request({
    url: api.addContract,
    method: 'post',
    data: parameter
  })
}
export function contractConfig (parameter) {
  return request({
    url: api.contractConfig,
    method: 'post',
    data: parameter
  })
}
export function getAddCon (parameter) {
  return request({
    url: api.addCon,
    method: 'post',
    data: parameter
  })
}
export function getProName (parameter) {
  return request({
    url: api.getName,
    method: 'post',
    data: parameter
  })
}
export function showUserNo (parameter) {
  return request({
    url: api.showUserNo,
    method: 'post',
    data: parameter
  })
}
export function exportContract (parameter) {
  return request({
    url: api.exportContract,
    method: 'post',
    data: parameter,
    responseType: 'blob'
  })
}

export function updatePDFConfig (parameter) {
  return request({
    url: api.updatePDFConfig,
    method: 'post',
    data: parameter
  })
}
